<template>
    <el-container>
        <el-container>
            <el-aside width="200px">
                <!-- background-color="#2b303b" -->
                <!-- text-color="#fff" -->
                <!--active-text-color="#ffd04b" -->
                <!-- 菜单开始 -->
                <!--  #region  -->
                <el-menu class="el-menu-vertical-demo" text-color="#fff" router>
                    <div class="title">后台管理系统</div>
                    <!-- 首页 -->
                    <el-menu-item index="home">
                        <el-icon>
                            <House />
                        </el-icon>
                        <span>首页</span>
                    </el-menu-item>
                    <!-- 系统概览 -->
                    <el-menu-item index="2">
                        <el-icon>
                            <Document />
                        </el-icon>
                        <span>系统概览</span>
                    </el-menu-item>
                    <!-- 用户管理 -->
                    <el-sub-menu index="3">
                        <template #title>
                            <!-- 字体图标 -->
                            <el-icon>
                                <User />
                            </el-icon>
                            <span>用户管理</span>
                        </template>
                        <el-menu-item-group title="管理员管理">
                            <el-menu-item index="3-1">产品管理员</el-menu-item>
                            <el-menu-item index="3-2">用户管理员</el-menu-item>
                            <el-menu-item index="3-3">消息管理员</el-menu-item>
                        </el-menu-item-group>
                        <el-menu-item-group title="员工管理">
                            <el-menu-item index="3-4">用户列表</el-menu-item>
                        </el-menu-item-group>
                    </el-sub-menu>
                    <!-- 产品管理 -->
                    <el-sub-menu index="4">
                        <template #title>
                            <!-- 字体图标 -->
                            <el-icon>
                                <TakeawayBox />
                            </el-icon>
                            <span>产品管理</span>
                        </template>
                        <el-menu-item-group title="入库管理">
                            <el-menu-item index="product_manage_list">产品列表</el-menu-item>
                        </el-menu-item-group>
                        <el-menu-item-group title="出库管理">
                            <el-menu-item index="out_product_manage_list">出库列表</el-menu-item>
                        </el-menu-item-group>
                    </el-sub-menu>
                    <!-- 消息管理 -->
                    <el-sub-menu index="5">
                        <template #title>
                            <!-- 字体图标 -->
                            <el-icon>
                                <ChatSquare />
                            </el-icon>
                            <span>消息管理</span>
                        </template>
                        <el-menu-item-group title="消息管理">
                            <el-menu-item index="message_list">消息列表</el-menu-item>
                        </el-menu-item-group>
                        <el-menu-item-group title="回收站">
                            <el-menu-item index="recycle">回收站</el-menu-item>
                        </el-menu-item-group>
                    </el-sub-menu>
                    <!-- 合同管理 -->
                    <el-menu-item index="6">
                        <el-icon>
                            <Files />
                        </el-icon>
                        <span>合同管理</span>
                    </el-menu-item>
                    <!-- 操作日志 -->
                    <el-menu-item index="7">
                        <el-icon>
                            <DocumentCopy />
                        </el-icon>
                        <span>操作日志</span>
                    </el-menu-item>
                    <!-- 登录日志 -->
                    <el-menu-item index="8">
                        <el-icon>
                            <Notebook />
                        </el-icon>
                        <span>登录日志</span>
                    </el-menu-item>
                    <!-- 系统设置 -->
                    <el-menu-item index="set">
                        <el-icon>
                            <Setting />
                        </el-icon>
                        <span>系统设置</span>
                    </el-menu-item>
                </el-menu>
                <!-- #endregion -->
                <!-- 菜单结束 -->
            </el-aside>
            <el-container>
                <el-header>
                    <span class="header-left-content">尊敬的会员，欢迎您登录本系统</span>
                    <div class="header-right-content">
                        <el-icon :size="20">
                            <Message />
                        </el-icon>
                        <el-avatar :size="24" :src="circleUrl" />
                        <el-dropdown>
                            <span class="el-dropdown-link">
                                设置
                            </span>
                            <template #dropdown>
                                <el-dropdown-menu>
                                    <el-dropdown-item>设置账号</el-dropdown-item>
                                    <el-dropdown-item>更改头像</el-dropdown-item>
                                    <el-dropdown-item @click="goLoginHome">退出登录</el-dropdown-item>
                                </el-dropdown-menu>
                            </template>
                        </el-dropdown>
                    </div>

                </el-header>
                <el-main>
                    <RouterView></RouterView>
                </el-main>
            </el-container>
        </el-container>
    </el-container>
</template>

<script lang="ts" setup>
import { RouterView,useRouter } from 'vue-router';
import { reactive, toRefs } from 'vue';
const router = useRouter()
const state = reactive({
    circleUrl:
        'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png'
})
const { circleUrl } = toRefs(state)
const goLoginHome = () => {
    router.push('/login')
}

</script>

<style lang="scss" scoped>
.el-aside {
    // height: 100vh;
    background-color: #2b303b;
    width: 210px;
    // 隐藏滚动条
    overflow-x: hidden;

    .el-menu {
        background-color: #2b303b;
        width: 210px;
        height: 100vh;
        border-right: none;

        .el-menu-item:hover {
            background-color: #006eff;
        }

        .el-menu-item-group {
            background-color: #2b303b;
        }
    }

    .title {
        padding: 20px;
        display: flex;
        justify-content: center;
        color: #fff;
        background-color: #2b303b;
    }
}


:deep(.el-sub-menu__title:hover) {
    background-color: #006eff;
}
.el-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 55px;
    background: #262f3e;
    color: #c1c6c8;
    .header-left-content {
        font-size: 14px;
    }
    .header-right-content {
        display: flex;
        align-items: center;
        width: 160px;
        justify-content: space-around;
        .el-dropdown-link {
            cursor: pointer;
        }
    }
    
}
.el-main {
    --el-main-padding: 0;
    background-color: #f3f4fa;
}
</style>
